<?php
/**
 * @Project NUKEVIET 3.0
 * @Author VINADES.,JSC (contact@vinades.vn)
 * @Copyright (C) 2010 VINADES., JSC. All rights reserved
 * @Createdate 3-6-2010 0:14
 */

if ( ! defined( 'NV_IS_MOD_SHOPS' ) ) die( 'Stop!!!' );
if ( ! defined( 'NV_IS_AJAX' ) ) die( 'Wrong URL' );
$row_id = $nv_Request->get_string( 'row_id', 'post,get',null );
$status = $nv_Request->get_string( 'status', 'post,get',"1" );
$compare = $_SESSION['compare']?$_SESSION['compare']:array();
if($status == "1"){
    if(!in_array($row_id, $compare)) $compare[] = $row_id;
}else{
    $compare = array_diff($compare,array($row_id));
}
$_SESSION['compare'] = $compare;
echo json_encode($compare);
?>